*=$0801
; 2018 SYS 2062
        !word   main-2, 10
        !byte   $9e
        !text   " 2062"
        !byte   $00,$00,$00
        
main        
        LDA     #%01111111      ; switch off interrupt signals from CIA-1
        STA     $DC0D
        AND     $D011           ; clear most significant bit of VIC's raster register
        STA     $D011
        LDA     $DC0D           ; acknowledge pending interrupts from CIA-1
        LDA     $DD0D           ; acknowledge pending interrupts from CIA-2
        SEI
        LDA     #<RASTER      ;Address of Raster interrupt routine
        STA     $0314
        LDA     #>RASTER
        STA     $0315
        LDA     #97  ;Line of next raster interrupt
        STA     $D012
        LDA     #1          ;Enable raster interrupts
        STA     $D01A
        CLI
        RTS
        

RASTER        
        LDA     $D019 ;Acknowledge interrupt
        STA     $D019
  
        
       LDX #0
       LDY #99
RASTERB1 LDA RASTERBAR,X
RASTERB2 CPY $D012
       BCS RASTERB2
       STA $D020
       INX
       INY
       CPX #RASTERBAREND-RASTERBAR
       BNE RASTERB1
        
       JMP     $EA31   ;End interrupt, but read keyboard, allowing BASIC to continue.
          

RASTERBAR
!byte 11,12,15,1,15,21,9,0

RASTERBAREND
